home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 027a / vntx.zip / CORRUPT.MAN < prev    next >
Text File  |  1991-02-07  |  4KB  |  133 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.           John T. Opincar, Jr.
  8.           CID 71631,541
  9.  
  10.  
  11.           INTRODUCTION
  12.           ============
  13.           Corrupted() is a function written in Clipper 5.0 (with a little
  14.           help from C) which verifies indices.  Specifically, corrupted()
  15.           checks for two situations.  First, corrupted() checks for any
  16.           references in the index to a record number greater than
  17.           lastrec().  This condition indicates that the database has been
  18.           packed without updating the indices.  Second, corrupted() checks
  19.           for any index entry whose key value does not match the
  20.           corresponding record.  This condition indicates that the record
  21.           was changed while the associated index was not open.
  22.  
  23.           You can use corrupted() in three ways.  You can compile and link
  24.           VNTX.EXE which is a DOS command line interface to corrupted().
  25.           You can also link corrupted() directly into your applications.
  26.           Finally, you can modify corrupted(), as complete source code is
  27.           provided.
  28.  
  29.           NOTE that corrupted() is written for 5.0.  However, you can still
  30.           use VNTX.EXE to verify S87 indices.
  31.  
  32.           NOTE also that you must declare any user-defined functions
  33.           referenced in your index keys EXTERNAL (see vntx.prg) and then
  34.           recompile and relink VNTX.EXE before attempting to verifty any
  35.           indices containing such references.
  36.  
  37.           You should have the following files:
  38.  
  39.           corrupt.man    This documentation file
  40.           corrupt.prg    Clipper source code for corrupted()
  41.           corrupt.ch     Clipper header file for corrupted()
  42.           corsupp.c      C support for corrupted()
  43.           corsupp.obj    Object code for the C support file
  44.           vntx.prg       Cliiper source code for a command line interface
  45.           create.bat     Batch file which compiles and links VNTX.EXE
  46.           createb.bat    Creation batch file for use with Blinker
  47.  
  48.  
  49.           VNTX.EXE
  50.           ========
  51.           VNTX.EXE is a command line interface for corrupted().  The syntax
  52.           for invoking VNTX is:
  53.  
  54.           VNTX <database name> <index name>
  55.  
  56.           VNTX will display its results as well as setting ERRORLEVEL.  An
  57.           ERRORLEVEL of 1 indicates that the index was corrupted.  An
  58.           ERRORLEVEL of 2 indicates that corrupted() was unable to check
  59.           the index for some reason, e.g. the index does not exist.  VNTX
  60.           will work on both S87 and 5.0 indices.
  61.  
  62.                                           1
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.           CORRUPTED()
  76.           ===========
  77.           Corrupted() is a Clipper 5.0 function which determines whether or
  78.           not an index is corrupted, and if so, how.  The syntax for
  79.           corrupted() is:
  80.  
  81.           corrupted(<sDbfName>, <sNtxName>, @<nBadRecno>) --> nErrorCode
  82.  
  83.           sDbfName and sNtxName are the names of the database and index
  84.           files to check, respectively.  nBadRecno is a variable you should
  85.           pass by reference.  If corrupted() determines that the index is
  86.           invalid, then the offending record number will be returned in
  87.           this variable.  Corrupted() returns the following error codes
  88.           defined in corrupt.ch:
  89.  
  90.           Result                             Value          Corrupt.ch
  91.           =================================================================
  92.           Record number out of bounds            2          CO_BADRECNO
  93.           Key mismatch                           1          CO_BADKEY
  94.           No Problems                            0          CO_OK
  95.           Unable to open index file             -1          CO_NTXOPEN
  96.           Unable to read index file             -2          CO_NTXREAD
  97.           Unable to find database file          -3          CO_BADDBF
  98.           Index key is not defined              -4          CO_KEYUNDEFINED
  99.  
  100.           See vntx.prg for an example of how to use corrupted().
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.                                           2
  129.  
  130.  
  131.  
  132.  
  133.